/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "LOTTERY_SCHEDULE", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "LotterySchedule.findAll", query = "SELECT l FROM LotterySchedule l"),
    @NamedQuery(name = "LotterySchedule.findById", query = "SELECT l FROM LotterySchedule l WHERE l.id = :id"),
    @NamedQuery(name = "LotterySchedule.findByDayOfWeek", query = "SELECT l FROM LotterySchedule l WHERE l.dayOfWeek = :dayOfWeek"),
    @NamedQuery(name = "LotterySchedule.findByDescription", query = "SELECT l FROM LotterySchedule l WHERE l.description = :description")})
public class LotterySchedule implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @Column(name = "DAY_OF_WEEK")
    private Short dayOfWeek;
    @Size(max = 400)
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "PROVINCE_ID", referencedColumnName = "ID")
    @ManyToOne
    private TinhThanh provinceId;

    public LotterySchedule() {
    }

    public LotterySchedule(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Short getDayOfWeek() {
        return dayOfWeek;
    }

    public void setDayOfWeek(Short dayOfWeek) {
        this.dayOfWeek = dayOfWeek;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public TinhThanh getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(TinhThanh provinceId) {
        this.provinceId = provinceId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LotterySchedule)) {
            return false;
        }
        LotterySchedule other = (LotterySchedule) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.LotterySchedule[ id=" + id + " ]";
    }
    
}
